package demo.thread;

/**
 * @author liuteng
 * @date 2017/8/2 16:42
 */
public class Producer extends Thread {
    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    private int num;

    public Storage getStorage() {
        return storage;
    }

    public void setStorage(Storage storage) {
        this.storage = storage;
    }

    private Storage storage;

    public Producer(Storage storage) {
        this.storage = storage;
    }

    @Override
    public void run() {
        produce(num);
    }

    public void produce(int num) {
        storage.produce(num);
    }
}
